package kr.hkit.powerjava.chapter24.work3.vo;

import java.io.Serializable;

public class Department implements Serializable, Comparable<Department> {
	private static final long serialVersionUID = -1527350953370805418L;
	private int dptNo;
	private String dptName;
	private int floor;

	public Department(int dptNo, String dptName) {
		this.dptNo = dptNo;
		this.dptName = dptName;
	}

	public Department(int dptNo, String dptName, int floor) {
		this.dptNo = dptNo;
		this.dptName = dptName;
		this.floor = floor;
	}

	public int getDptNo() {
		return dptNo;
	}

	public void setDptNo(int dptNo) {
		this.dptNo = dptNo;
	}

	public String getDptName() {
		return dptName;
	}

	public void setDptName(String dptName) {
		this.dptName = dptName;
	}

	public int getFloor() {
		return floor;
	}

	public void setFloor(int floor) {
		this.floor = floor;
	}

	@Override
	public String toString() {
		return String.format("%3s\t%5s\t%3s", dptNo, dptName, floor);
	}

	@Override
	public boolean equals(Object obj) {
		boolean result = false;
		if (obj instanceof Department) {
			Department temp = (Department) obj;
			result = (dptNo == temp.dptNo && dptName.equals(temp.dptName));
			return result;
		}
		return result;
	}

	@Override
	public int compareTo(Department o) {
		return dptNo - o.dptNo;
	}

}
